home *** CD-ROM | disk | FTP | other *** search
- ; doint.a - perform interrupt call.
- ; (C) Copyright 1985 Cray Research Inc. - All Rights Reserved.
- ; G. R. Mansfield. 85/08/23.
- ; Ver 1.0-5A14.
-
-
- dseg
- public _carryf_, _zerof_
- public _rax_, _rcx_, _rdx_, _rbx_
- public _rsi_, _rdi_, _res_, _rds_
-
- ; maintain order of these variables.
-
- _zerof_: ; zf
- db 0
- _carryf_: ; cf
- db 0
-
- _rax_ dw 0 ; ax
- _rcx_ dw 0
- _rdx_ dw 0
- _rbx_ dw 0
- _rsi_ dw 0
- _rdi_ dw 0
- _res_ dw -1
- _rds_ dw -1
-
- cseg
- public _doint_
- public _dosint_
-
- _dosint_:
- mov bx,sp
- mov ah,[bx+2] ; set function number
- mov byte inta+1,021h
- jmp int1
-
- _doint_:
- mov bx,sp
- mov al,[bx+2] ; set interrupt number
- mov inta+1,al
- mov ax,_rax_ ; load registers
- int1: mov cx,_rcx_
- mov dx,_rdx_
- mov bx,_rbx_
- mov si,_rsi_
- push es
- les di,dword _rdi_
- cmp _rds_,0FFFFh
- je int2
- mov ds,_rds_
- int2:
- inta: int 0
- push ds ; restore ds
- push ss
- pop ds
- pop _rds_
- mov _rax_,ax ; store registers
- mov _rcx_,cx
- mov _rdx_,dx
- mov _rbx_,bx
- mov _rsi_,si
- mov _rdi_,di
- mov _res_,es
- pop es
- lahf ; carry flag
- mov al,ah
- rol al,1 ; zero flag
- and ax,00101h
- mov word _zerof_,ax
- cld
- ret
-